function randomString(len: number, key: string = 'def') {
    const charMap = {
        alphanumeric: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ',
        def: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz',
        lower: 'abcdefghijklmnopqrstuvwxtz',
        numbers: '0123456789',
        safe: '2346789ABCDEFGHJKLMNPRTUVWXTZ',
        upper: 'ABCDEFGHIJKLMNOPQRSTUVWXTZ',
    };
    let str = '';
    if (len > 0) {
        const chars = charMap[key] || charMap['def'];
        for (let i = 0; i < len; i++) {
            str += chars.charAt(Math.floor(Math.random() * chars.length));
        }
    }
    return str;
}

function isSymbolChar(char) {
    let isTrue = false;
    const symbolArr = ['，', '。', '？'];
    if (symbolArr.indexOf(char) >= 0) {
        isTrue = true;
    }
    return isTrue;
}
